<%@page contentType="text/html"%>
<%@page pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>

<link href="css/jquery.treeview.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<s:url value='/js/jquery.treeview.js'/>"></script>

<script>

$(document).ready(function(){
    $("#matrix").treeview({
		animated: "fast"		
	});
  });

$(function() {
	$( "input:submit" ).button();	
});


</script>

<div id="content">
	<div class="post">
	<h2>Matriks Anggota</h2>                    
        <div class="entry">        	                       
           	<table cellspacing="10" >
           		<tr>
					<td>Nama:</td>															
					<td><s:label name="member.name"/></td>
				</tr>
				
				<tr>
					<td>Email:</td>															
					<td><s:label name="member.email"/></td>
				</tr>																											
           	</table>             	                        	          	        
           	
           	<ul id="matrix" class="treeview-gray">
           		<li><span><s:property value="member.name"/> ( <s:property value="member.email"/> )</span>
           		
           			<c:if test="${not empty matrix.level1}">	
	           			<ul>
	           				<c:forEach var="level1" items="${matrix.level1}">		   						   					
								<li><span><c:out value="${level1.name}"/> ( <c:out value="${level1.email}"/> )</span>																	
									<c:set var="mapLevel2" value="${matrix.level2}" scope="page"/>								
									<c:set var="listLevel2" value="${mapLevel2[level1.id]}" scope="page"/>
								
									<c:if test="${not empty listLevel2}">																													
										<ul>								
											<c:forEach var="level2" items="${listLevel2}">
												<li><span><c:out value="${level2.name}"/> ( <c:out value="${level2.email}"/> )</span></li>
											</c:forEach>																		
										</ul>
									</c:if>
								</li>																																									
		   					</c:forEach> 
	   					</ul>  					           					
   					</c:if>					
				</li>				
           	</ul>
           	                         
        </div>
	</div>
</div>